/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package orm;

import java.util.List;
import org.hibernate.criterion.DetachedCriteria;
import org.orm.PersistentSession;
import org.orm.criteria.*;

public class ComunaDetachedCriteria extends AbstractORMDetachedCriteria {
	public final IntegerExpression co_id;
	public final StringExpression co_nombreprovincia;
	
	public ComunaDetachedCriteria() {
		super(orm.Comuna.class, orm.ComunaCriteria.class);
		co_id = new IntegerExpression("co_id", this.getDetachedCriteria());
		co_nombreprovincia = new StringExpression("co_nombreprovincia", this.getDetachedCriteria());
	}
	
	public ComunaDetachedCriteria(DetachedCriteria aDetachedCriteria) {
		super(aDetachedCriteria, orm.ComunaCriteria.class);
		co_id = new IntegerExpression("co_id", this.getDetachedCriteria());
		co_nombreprovincia = new StringExpression("co_nombreprovincia", this.getDetachedCriteria());
	}
	
	public RegionDetachedCriteria createRegionre_numeroregionCriteria() {
		return new RegionDetachedCriteria(createCriteria("regionre_numeroregion"));
	}
	
	public Comuna uniqueComuna(PersistentSession session) {
		return (Comuna) super.createExecutableCriteria(session).uniqueResult();
	}
	
	public Comuna[] listComuna(PersistentSession session) {
		List list = super.createExecutableCriteria(session).list();
		return (Comuna[]) list.toArray(new Comuna[list.size()]);
	}
}

